<template>
	<view class="box">
		<view class="top">
			<u-navbar :is-back="true" title="用户评价" :border-bottom="false" :title-bold="true"></u-navbar>
		</view>
		<view class="commentView" v-for="(item,index) in commentList" :key="index" v-if="commentList.length>0">
			<view class="commentUser">
				<u-avatar :src="item.user.avatar_format" size="70"></u-avatar>
				<view class="userInfo">
					<view class="username">
						<text>{{item.user.nickname}}</text>
						<span v-if="item.goods_star==1">特别差</span>
						<span v-if="item.goods_star==2">差</span>
						<span v-if="item.goods_star==3">一般</span>
						<span v-if="item.goods_star==4">好</span>
						<span v-if="item.goods_star==5">非常好</span>
					</view>
					<view class="commentTime">
						<text>{{item.created_at}}</text>
						<u-rate :count="5" v-model="item.goods_star" disabled :size="10"
							active-color="#FFAC0E"></u-rate>
					</view>
				</view>
			</view>
			<view class="commentText">{{item.content}}</view>
			<view class="commentImage" v-if="item.images_format" v-for="(c,i) in item.images_format" :key="i">
				<image class="imageIcon" :src="c" mode="aspectFill"></image>
			</view>
			<view class="commentReplay flc">
				<view class="name">
					商家回复
				</view>
				<span>感谢你的支持，加油赞，我们会继续努力</span>
			</view>
		</view>
		<u-empty text="没有数据哦" mode="message" v-else></u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				commentList: []
			};
		}
	}
</script>

<style lang="scss">
	.commentView {
		display: flex;
		flex-direction: column;
		background: #FFFFFF;
		padding: 20rpx 0px;
	}

	.commentUser {
		display: flex;
		flex-direction: row;
	}

	.userInfo {
		flex: 1;
		display: flex;
		flex-direction: column;
		margin-left: 10rpx;
	}

	.username {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
	}

	.commentTime {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-weight: 400;
		font-size: 20rpx;
		color: #999;
	}

	.commentText {
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		margin-top: 20rpx;
	}

	.commentImage {
		display: flex;
		flex-wrap: wrap;
		margin-top: 20rpx;
	}

	.imageIcon {
		width: 216rpx;
		height: 145rpx;
		margin-right: 20rpx;
	}

	.commentReplay {
		padding: 18rpx 0;
		border-top: 1rpx solid #dedede;
		color: #999999;
		font-size: 26rpx;

		.name {
			font-size: 28rpx;
			color: #333333;
		}
	}
</style>